<!--
 * @description: 
 * @Author: lal
 * @Date: 2020-08-15 10:50:53
 * @LastEditors: lal
 * @LastEditTime: 2020-08-31 09:47:14
-->
<template>
  <div id="nav">
    <el-menu :default-active="onRoutes" class="el-menu-vertical-demo" router collapse>
      <el-menu-item index="/">
        <i class="iconfont icon--bianyi"></i>
        <span slot="title">markdown转换</span>
      </el-menu-item>
      <el-menu-item index="/layout/calc">
        <i class="iconfont icon-TFDD-"></i>
        <span slot="title">加班计算器</span>
      </el-menu-item>
      <el-menu-item index="/layout/tree">
        <i class="iconfont icon-TreeNormal"></i>
        <span slot="title">tree命令</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
export default {
  name: "Sidebar",
  props: {},
  data() {
    return {};
  },
  computed: {
    onRoutes: {
      get() {
        const { fullPath } = this.$route;
        if (fullPath.includes("/redirect")) {
          return fullPath.slice(9);
        } else {
          return fullPath;
        }
      },
      set(val) {
        return val;
      },
    },
  },
  created() {},
  methods: {},
};
</script>

<style scoped lang="scss"></style>
